import {post,postcontent,get} from "../api";
// 大屏底部监控管理列表
export const topcameralist  =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/camera/topcameralist',  params).then(res=>{
      resolve(res.data)
    }).catch(err=>{
      reject(err.data)
    })
  }) 
// 实时卡口数据墙（列表）
export const bayonetcarsrecord  =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/bayonetcarsrecord',  params).then(res=>{
      resolve(res.data)
    }).catch(err=>{
      reject(err.data)
    })
  }) 
// 24小时个时间段进出分布（折线图）
export const inandoutbyhour  =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/inandoutbyhour',  params).then(res=>{
      resolve(res.data)
    }).catch(err=>{
      reject(err.data)
    })
  })
  //各卡口车辆进出情况（柱状图） 
  export const inandoutbybayonetbar  =(params)=>new Promise((resolve,reject)=>{
    post('/mpsh/client/screen/inandoutbybayonetbar',  params).then(res=>{
        resolve(res.data)
      }).catch(err=>{
        reject(err.data)
      })
    })
  // 获取视频URL /mpsh/client/camera/preview
export const preview =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/camera/preview',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
  // /mpsh/client/screen/camerastats
  export const camerastats =(params)=>new Promise((resolve,reject)=>{

    post('/mpsh/client/screen/camerastats',  params).then(res=>{
      resolve(res.data)
    }).catch(err=>{
      reject(err.data)
    })
  }) 

  //摄像头列表 client/screen/camerastatslist
  export const camerastatslist =(params)=>new Promise((resolve,reject)=>{

    post('/mpsh/client/screen/camerastatslist',  params).then(res=>{
      resolve(res.data)
    }).catch(err=>{
      reject(err.data)
    })
  }) 
// 告警信息统计  
export const alarmstatline =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/alarmstatline',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// 危化品车辆告警（饼状图） 
export const jimialarmpie =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/jimialarmpie',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
})
//危化品车辆告警（列表）  
export const jimialarmlist =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/jimialarmlist',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
})

// 石化九路与素海璐交叉口管廊上
export const uav =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/uav',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
})

// 重型化工消防站楼顶
export const uav2 =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/uav2',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
})

// 石化九路与素海璐交叉口管廊上列表
export const uavhistory =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/uavhistory',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
})
// 重型化工消防站楼顶列表
export const uav2history =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/uav2history',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
})
// 告警记录查询
export const alarmrecord =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/alarmrecord',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
})
// 
//更新状态userProvider/updateVehicleStatus
export const getEyes  =(params)=>new Promise((resolve,reject)=>{
 
  post('/mpsh/client/camera/list',  params).then(res=>{
      resolve(res.data)
    }).catch(err=>{
      reject(err.data)
    })
  }) 
// /mpsh/client/camera/sysdata
export const sysdata =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/camera/sysdata',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 

// 获取图表接口https://tbk.mpcheshi.com/mpsh//mpsh/client/screen/show
export const syshow =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/show',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// /mpsh/client/screen/bayonetcarstats 闸机进出总量统计
export const bayonetcarstats =(params)=>new Promise((resolve,reject)=>{

  post('/mpsh/client/screen/bayonetcarstats',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
 

export const carposinfo =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/carposinfo',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// /mpsh/client/screen/getdetails
export const getdetails =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/getdetails',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 

// mpsh/client/screen/cartrack
export const cartrack =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/cartrack',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
 
//  
export const alarm =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/api/alarm/list',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
export const dispose =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/api/alarm/dispose',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// 获取人员 /mpsh/client/screen/person
export const person =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/person',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// 热力图 mpsh/client/screen/heatmap
export const heatmap =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/heatmap',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// 电子巡查 mpsh/client/screen/emergency
export const emergency =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/emergency',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// 电子轨迹 mpsh/client/screen/emergencytrack
export const emergencytrack =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/emergencytrack',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// mpsh/client/screen/personandcarnum
export const personandcarnum =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/personandcarnum',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// 无人机/mpsh/client/screen/uav
export const peruav =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/uav',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
 

//历史记录 /admin/alarm/list
export const alarmList =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/admin/alarm/list',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 

//  http://tbk.mpcheshi.com/mpsh/client/screen/updateasset  监控

export const update =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/updateasset',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 

// http://tbk.mpcheshi.com/mpsh/client/screen/updatebayonet 卡口
export const updatebayonet =(params)=>new Promise((resolve,reject)=>{
  post('/mpsh/client/screen/updatebayonet',  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
 
var base_url = 'http://218.92.31.102:8421/datasupport'
/**
 * 获取code
 */

 export const getCode =(params)=>new Promise((resolve,reject)=>{
  post(`${base_url}/api/sys/tokenlogin`,  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 

/**
 * 获取findareahourcurrent 环境质量
 */
 export const getfindareahourcurrent =(params)=>new Promise((resolve,reject)=>{
  get(`${base_url}/thirdparty/station/findareahourcurrent`,  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
/*
 * 获取水质 querywatersource
*/ 
export const getquerywatersource =(params)=>new Promise((resolve,reject)=>{
  get(`${base_url}/thirdparty/querywatersource`,  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
/**
 * 获取指标queryyeargoal
*/
export const getqueryyeargoal =(params)=>new Promise((resolve,reject)=>{
  
  get(`${base_url}/thirdparty/queryyeargoal`,  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// 获取 河流折现图 queryairmonthcount
export const getqueryairmonthcount =(params)=>new Promise((resolve,reject)=>{
  
  get(`${base_url}/thirdparty/queryairmonthcount`,  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// 大屏滚动findswdatalist
export const getfindswdatalist =(params)=>new Promise((resolve,reject)=>{
  
  get(`${base_url}/thirdparty/findswdatalist`,  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 
// querynewdangertrash 危险废物动态流转
export const getquerynewdangertrash=(params)=>new Promise((resolve,reject)=>{
  
  get(`${base_url}/thirdparty/querynewdangertrash`,  params).then(res=>{
    resolve(res.data)
  }).catch(err=>{
    reject(err.data)
  })
}) 